package com.zx.sercurity;

import java.util.List;

public abstract class RiskResult<T> {

    private boolean inRisk = false;
    private T data;


    public RiskResult() {
        inRisk = false;
    }

    public RiskResult(boolean inRisk) {
        this.inRisk = inRisk;
    }

    public RiskResult(boolean inRisk, T data) {
        this.inRisk = inRisk;
        this.data = data;
    }

    public boolean isInRisk() {
        return inRisk;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public abstract RiskEnum getType();


    public static class IDLE extends RiskResult<Void> {
        public IDLE(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.IDLE;
        }
    }

    public static class AccessibilityServiceRiskResult extends RiskResult<List<String>> {
        public AccessibilityServiceRiskResult(boolean inRisk) {
            super(inRisk);
        }

        public AccessibilityServiceRiskResult(List<String> data) {
            super(true, data);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.AccessibilityServiceRisk;
        }
    }

    public static class MTManagerRiskResult extends RiskResult<Void> {
        public MTManagerRiskResult(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.MTManagerRisk;
        }
    }


    public static class NetProxyRiskResult extends RiskResult<Void> {
        public NetProxyRiskResult(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.NetProxyRisk;
        }
    }

    public static class CustomCertificatesRiskResult extends RiskResult<List<String>> {
        public CustomCertificatesRiskResult(boolean inRisk) {
            super(inRisk);
        }

        public CustomCertificatesRiskResult(List<String> data) {
            super(true, data);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.CustomCertificatesRisk;
        }
    }

    public static class MovementDetectorRiskResult extends RiskResult<Void> {
        public MovementDetectorRiskResult(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.MovementDetectorRisk;
        }
    }

    public static class BatteryRiskResult extends RiskResult<Void> {
        public BatteryRiskResult(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.BatteryRisk;
        }
    }

    public static class ChargingRiskResult extends RiskResult<Void> {
        public ChargingRiskResult(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.ChargingRisk;
        }
    }

    public static class NoSIMRiskResult extends RiskResult<Void> {
        public NoSIMRiskResult(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.NoSIM;
        }
    }

    public static class EmulatorRiskResult extends RiskResult<Void> {
        public EmulatorRiskResult(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.IsEmulator;
        }
    }

    public static class DebugModeRiskResult extends RiskResult<Void> {
        public DebugModeRiskResult(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.DebugMode;
        }
    }

    public static class RootRiskResult extends RiskResult<List<String>> {

        public RootRiskResult(boolean inRisk) {
            super(inRisk);
        }

        public RootRiskResult(boolean inRisk, List<String> data) {
            super(inRisk, data);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.RootRisk;
        }
    }


    public static class VPNRiskResult extends RiskResult<Void> {

        public VPNRiskResult(boolean inRisk) {
            super(inRisk);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.VPNRisk;
        }
    }

    public static class ApplicationRiskResult extends RiskResult<List<String>> {

        public ApplicationRiskResult(boolean inRisk) {
            super(inRisk);
        }

        public ApplicationRiskResult(List<String> data) {
            super(true,data);
        }

        @Override
        public RiskEnum getType() {
            return RiskEnum.ApplicationRisk;
        }
    }



}
